<?php
namespace App\Models;

use DB;
use Illuminate\Database\Eloquent\Model;

class TopicFavourM extends Model
{
    protected $table='lee_topic_favour';
    static public $STable='lee_topic_favour';
    
    /**
     * 添加  用户--话题 数据记录
     *  formats ['userid'=>userid1,'topicid'=>topicid1]
     * @param array $data
     */
    static public function addItem(array $data){
       $Inst=new TopicFavourM();
       $Inst->userid=$data['userid'];
       $Inst->topicid=$data['topicid'];
       $Inst->save();
    }
    
    /**
     * 删除  用户-话题  话题 数据记录
     *  formats ['userid'=>userid1,'topicid'=>topicid1]
     * @param array $data
     */
    static public function dltItem(array $data){
        self::where($data)->delete();
    }
    
}

?>